package org.wotou.authority.dao.wtuser;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;
import org.wotou.authority.domain.wtlogDO;
import org.wotou.authority.domain.wtuser.wtuserDO;

import java.io.Serializable;
import java.util.List;

/**
 * 用户操作dao
 *
 * @author zhangQ
 * @date 2017/12/19
 */
@Repository
public interface WtuserDAO extends JpaRepository<wtuserDO, Serializable>, JpaSpecificationExecutor<wtuserDO> {

    @Query("select c from wtuserDO c")
    public int findAllByOrgId();

    /**
     * @param userName
     * @return
     */
    @Query("select wtuser from wtuserDO wtuser where wtuser.userName =:userName")
    public List<wtuserDO> findByUserName(@Param("userName") String userName);
}
